<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="Icons/scicon.png">
<link rel="stylesheet"
	href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet"
	href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script
	src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link href="Styles/register.css" rel="stylesheet">
<title>Register</title>
</head>
<body>
	<div class="container">
		<form class="form-signin" role="search"
			action="RegisterServlet" method="post" enctype="multipart/form-data">
			<img src="Images/logoSmartContext.png" width="70%" height="70%" style="display: block;margin: auto;">
			<% if(request.getQueryString()!=null)
			{
				String errType = request.getParameter("Error");
				
				if(errType.equals("1")){
					out.println("<p style=\"color:maroon\">*Complete the fields*</p>");
				}else if (errType.equals("2")){
					out.println("<p style=\"color:maroon\">*The passwords doesn't match*</p>");
				}else if (errType.equals("3")){
					out.println("<p style=\"color:maroon\">*The username exists*</p>");
				}else if (errType.equals("4")){
					out.println("<p style=\"color:maroon\">*The username or password should be less than 16 chars*</p>");
				}else if (errType.equals("5")){
					out.println("<p style=\"color:maroon\">*Error creating the context sphere. Try again</p>");
				}
				
			}
				
			%>
			<div class="form-group">
				<input type="text" name="name" class="form-control" placeholder="Your name" required autofocus>
				<input type="email" name="email" class="form-control" placeholder="Email Address" required>
				<input type="text" name="username" class="form-control" placeholder="Your username" required>
				<input type="password" name="password" class="form-control" placeholder="Password" required>
				<input type="password" name="passwordR" class="form-control" placeholder="Repeat password" required>
				<button class="btn btn-lg btn-primary btn-block" type="submit">Register</button>
	<br>
	<a href="login.jsp">.. or sign in</a>
			</div>
		</form>
	</div>
</body>
</html>